﻿#pragma once

#include <any>

namespace Shared::Extensions
{
    class HelperExtensions final
    {
    public:
        template<typename T>
        static T ValueOrDefault(std::any value)
        {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            if (!value.has_value() || value.ToString() == "")
            {
                return T();
            }

            return std::any_cast<T>(Convert::ChangeType(value, typeid(T)));
        }
    };
}
